package 面试.动态代理.JDK;

import java.lang.reflect.Proxy;

public class ProxyFactory {
    /**
     *
     * @param target 代理类的真实对象
     * @return
     */
    public static Object getProxy(Object target){
        /**
         * DebugInvocationHandler自己实现的动态代理类
         */
        return Proxy.newProxyInstance(target.getClass().getClassLoader(),target.getClass().getInterfaces(),new DebugInvocationHandler(target));
    }
}
